/**
 * Created by zhouli on 2019/1/21
 * 数据权限需要使用的一些数据模型
 */
import {deepCopy, messages } from "share/common";


//新增条件细项,默认模型
//todo
//此条件细项模型只适用于成本中心字段，如果其他字段，需要另外写数据模型
let conditionItemExample = {
  "fieldCode": undefined,//模块下面的字段
  "subFieldValue": undefined,//成本中心 id
  "subFieldName": undefined,//成本中心 name
  "conditionLogic": "IR",//默认包含范围
  "conditionSeq": 1,//条件细项的序号
  "enabled": true,
  "conditionValues": [
    //成本中心字段， conditionValues  必须是两个字段，代表成本
    //中心项代码从 到
    {},
    {}
  ]
};
//新增条件，默认模型
let conditionExample = {
  "sequence": null,
  "entityCode": undefined,//模块,添加的时候，根据已经选择的模块赋值
  "conditionDetails": [
    deepCopy(conditionItemExample)
  ]
};
//条件下的模块
let conditionLimitStr = [
  {
    moduleCode: "Expense",
    moduleName: messages('permission-setting.key83')/*报销单*/,
  },
  {
    moduleCode: "Application",
    moduleName: messages('permission-setting.key88')/*申请单*/
  },
  {
    moduleCode: "LoanApplication",
    moduleName: messages('permission-setting.key84')/*借款申请单*/
  },
];
//条件下模块下面的字段
let conditionFieldArr = [
  {
    fieldCode: "CostCenter",
    fieldName: messages('permission-setting.key85')/*成本中心*/,
  },
  // {
  //   fieldCode: "dep",
  //   fieldName: '部门',
  // },
];
let includeOrExpectArr = [
  {
    code: "IR",
    name: messages('permission-setting.key86')/*包含范围*/,
  },
  // {
  //   code: "I",
  //   name: '包含',
  // },
  // {
  //   code: "E",
  //   name: '不包含',
  // },
  // {
  //   code: "ER",
  //   name: '不包含范围',
  // },
];
export {
  conditionExample,
  conditionItemExample,
  conditionLimitStr,
  conditionFieldArr,
  includeOrExpectArr
}
